<template>
  <div>
    <h2>vue开发的收银系统</h2>
    <span>苹果{{money}}￥/斤，折扣：{{discount}}折</span>
    <div>
      <span>请输入你要购买的斤数：</span>
      <input type="text" v-model.number="num" />
    </div>
    <div >
      <span>总价：{{money*num}}元</span><br />
      <span>折后价：{{money*num* (discount/10) }}元</span><br />
      <span>省了：{{money*num*(1-(discount /10)).toFixed(2)}}元</span>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      num: "",
      money:10,
      discount: 8,
    };
  },
  methods: {
    
  },
};
</script>

<style>
</style>